---
layout: "default"
title: "Zip2Iterator"
description: "Swift documentation for 'Zip2Iterator': An iterator for Zip2Sequence."
keywords: "Zip2Iterator,struct,swift,documentation,next,Element"
root: "/v3.1"
---

<div class="intro-declaration"><code class="language-swift">struct Zip2Iterator&lt;Iterator1, Iterator2 where Iterator1 : IteratorProtocol, Iterator2 : IteratorProtocol&gt;</code></div>

<div class="discussion comment">
    <p>An iterator for <code>Zip2Sequence</code>.</p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<code class="inherits">IteratorProtocol</code>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>

<tr>
<th id="aliases">Associated Types</th>
<td>
<span id="aliasesmark"></span>
<div class="declaration">
<code class="language-swift">Element = (Iterator1.Element, Iterator2.Element)</code>
<div class="comment">
    <p>The type of element returned by <code>next()</code>.</p>
</div>
</div>
</td>
</tr>


<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>







<h3>Instance Methods</h3>
<div class="declaration" id="func-next">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-next">mutating func next()</a>
        
<div class="comment collapse" id="comment-func-next"><div class="p">
    <p>Advances to the next element and returns it, or <code>nil</code> if no next element
exists.</p>

<p>Once <code>nil</code> has been returned, all subsequent calls return <code>nil</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func next() -&gt; Zip2Iterator.Element?</code>
    
    
</div></div>
</div>


